/*-----------------------------------------------------------------------------------
 *
 * 프로그램명	: shopDAO.java
 * Version		: 1.0
 * 작성일 		: 2006-08-16
 * 작성자		:
 * 수정일 		:
 * 수정자		:
 * 설명		 	:
 * 기능		 	:
 *
 * Copyright (c) 2000 by H&H  All Rights Reserved.
 *
-------------------------------------------------------------------------------------*/
package com.qbooks.cms.sales;

import java.io.*;

import java.util.*;
import java.sql.*;

import com.zll.framework.db.DBManager;
import com.zll.framework.model.HashBox;
import com.zll.framework.model.HashList;



public class SalesDAO
{
	public HashList selectSalesList(HashMap infos) throws Exception
	{
        return DBManager.executeQuery("/sales.xml", "select_sales_list", infos);
	}


	/**
	 * Member 저장
	 *
	 * @param	infos
	 * @return	boolean
	 */
	public void saveMember(HashBox box) throws Exception
    {
		Connection conn = null;

        try
		{
			conn = DBManager.getConnection();

			HashMap map = box.getParam();

	    	if ("C".equals(map.get("job_type"))) {
	    		DBManager.executeUpdate("/homepage.xml", "insert_member", map, conn);
	       	} else if ("U".equals(map.get("job_type"))) {
	       		DBManager.executeUpdate("/homepage.xml", "update_member", map, conn);
	       	} else if ("D".equals(map.get("job_type"))) {
	       		DBManager.executeUpdate("/homepage.xml", "delete_member", map, conn);
	        }

			conn.commit();
	    }
	    catch(Exception e)
	    {
	    	DBManager.rollback(conn);
	    	throw e;
		}
	    finally
	    {
	    	DBManager.closeConnection(conn);
		}
    }


}
